home *** CD-ROM | disk | FTP | other *** search
/ Star Trek Starfleet Academy Mini Omnipedia / MINI_OMNI.ISO / pc / omni_v2.dxr / 00370_general control.ls < prev    next >
Encoding:
Text File  |  1996-04-15  |  20.1 KB  |  584 lines

  1. global gAlphaState, gAlphBase, gAssetPath, gColorXobj, gComputerTypeK, gdescfield, gdescfieldscriptcast, gdescfieldspr, gEncSprite, gEntrySprite, gEpisBase, gEpisFTchunksizeK, gFindBase, gFirstYearK, gFlashPixel, gGlobalStepCount, gHeaderHere, gHltPixel, gHoldEncPixelSprite, gHoldEntPixelSprite, gHotLinkList, gImInHelp, gInputFieldSpr, gLastYearK, glinktostagemsg, gMacColorIsHere, gMemoryAlertFlag, gModeBase, gModeHighltSprite, gModeNameLU, gModeState, gNewSetIsHereF, gNextBase, gOurFontK, gPDL, gPrepareSND, gPrevActiveColor, gPrevInactiveColor, gPullDownModes, gPullDownSearch, gScrollIncrK, gscrtxtspr1, gSearchButton, gSearchPopOut, gSpeeButtSpr, gSpeechCapable, gStageToLinkMsg, gStardateLU, gStardLUlistSize, gStashedHitsList, gStashedSEEList, gStatusField, gStatusWordList, gStretchSpr1, gStretchSpr2, gStylingNeedF, gSysStatusWordSpr, gTheMseLine, gTheMseWord, gTickSND, gTopicBase, gTopicLocList, gTopIsPaused, gTrekCursor, gTTSactive, gTxtScrSprsBeg, gUpdateAttribFld, gUpdateBase, gWinTypeList, oChartSlider, oCHROTextSlider, oCreditSlider, oHelpRoll, oHelpTextSlider, oIndexMediator, oIndexScroller, oIndexSlider, oINTERfaceFind, oINTERfaceModes, oPWin, oTextScroller, oTextSlider, oTopicSlider, oWinKey, oTopicControl, gInputField, gSavedMouseUpScript, gVoiceHandler, oVidCD, oImport, oFile, gDirectOrFolderK, oPrintMe, gFirstSpeechF
  2.  
  3. on hLetsStart
  4.   global gCurrentlyPlayingMovie, gVideoPath
  5.   set gCurrentlyPlayingMovie to " "
  6.   put RETURN & "‚Ä¢‚Ä¢Play begins..."
  7.   go("OPEN")
  8.   go("OpHere")
  9.   puppetSound("oneHiBeep")
  10.   repeat with i = label("OpHere") to label("OpB")
  11.     go(i)
  12.     updateStage()
  13.     set x to the timer
  14.     repeat while the timer < (x + 1)
  15.     end repeat
  16.   end repeat
  17.   puppetSound("double Beep")
  18.   go("OpB")
  19.   hPrepCursor()
  20.   hInitSNDnames()
  21.   hearit(gPrepareSND)
  22.   updateStage()
  23.   set x to the timer
  24.   repeat while the timer < (x + 1)
  25.   end repeat
  26.   go("Opc1")
  27.   set gStatusField to the number of cast "Status"
  28.   hReportStatus("Preparing...")
  29.   updateStage()
  30.   set x to the timer
  31.   repeat while the timer < (x + 1)
  32.   end repeat
  33.   go("OpC2")
  34.   updateStage()
  35.   set x to the timer
  36.   repeat while the timer < (x + 1)
  37.   end repeat
  38.   set gVideoPath to gAssetPath
  39.   set the fileName of cast "SS_LOGO.MOV" to gVideoPath & "S" & gPDL & "SS_LOGO.MOV"
  40.   set gNewSetIsHereF to 0
  41.   hInitConstants()
  42.   if gComputerTypeK = #WIN then
  43.     hSetWindowsColor()
  44.   else
  45.     hSetMacColor()
  46.   end if
  47.   set oVidCD to birth(script "Multi-CD Video Fetching")
  48.   hTestforCDin()
  49.   hPrepareAll()
  50. end
  51.  
  52. on hPrepCursor
  53.   set gTrekCursor to the number of cast "trekcursFG"
  54. end
  55.  
  56. on hPrepareAll
  57.   set gdescfield to the number of cast "F1"
  58.   hInitThumbholders()
  59.   hInitMode()
  60.   set gHotLinkList to [:]
  61.   set the itemDelimiter to RETURN
  62.   set gFirstSpeechF to 1
  63.   hAnnounce("Now establishing datalink")
  64.   put "Initializing indexes..." into field "status"
  65.   hInitMainIndex()
  66.   set oIndexSlider to birth(script "SliderManagerTall", 1, 4070, "mStartIndexToLine(oIndexScroller,mShowVal(oIndexSlider))", 30, 63, 67, 27, 63, 121, 1, 0)
  67.   set oTextSlider to birth(script "SliderManagerTall", 0, 1, "mScrollBarTextScroll(oTextScroller,mShowVal(oTextSlider))", 34, 213, 212, 31, 208, 378, 0, 0)
  68.   set Lchromax to mGetAnyMaxEntryNum(oIndexMediator, #CHRO)
  69.   set oHelpTextSlider to birth(script "SliderManagerTall", 0, 1, "mScrollBarTextScroll(oTextScroller,mShowVal(oHelpTextSlider))", 34, 208, 212, 31, 208, 383, 0, 0)
  70.   set oCreditSlider to birth(script "SliderManagerTall", 0, 1, "mScrollBarCreditScroll(oTextScroller,mShowVal(oCreditSlider))", 8, 44, 48, 5, 44, 220, 0, 0)
  71.   set oChartSlider to birth(script "SliderManagerTall", 0, 1, "mScrollBarChartScroll(oTextScroller,mShowVal(oChartSlider))", 8, 44, 48, 5, 44, 220, 0, 0)
  72.   set oHelpRoll to birth(script "HelpRoll Parent", HelpRects())
  73.   set oFile to birth(script "fileparent")
  74.   set gImInHelp to 0
  75.   set oPWin to birth(script "pWinScripts")
  76.   go("OpD2")
  77.   updateStage()
  78.   set x to the timer
  79.   repeat while the timer < (x + 20)
  80.   end repeat
  81.   hPrepStyles(gdescfield)
  82.   set the textFont of field "status" to gOurFontK
  83.   put "O.K." into field "status"
  84.   hInitInputParams()
  85.   set the textFont of field gInputField to gOurFontK
  86.   hAnnounce("Welcome to fed...databank")
  87.   go("OpE")
  88.   set glinktostagemsg to EMPTY
  89.   set gStageToLinkMsg to EMPTY
  90.   set gTopicLocList to [:]
  91.   set oWinKey to birth(script "WinkeyParent")
  92.   set gVoiceHandler to EMPTY
  93.   repeat with i = label("interfaceBuild") to label("interfaceBuildEnd")
  94.     go(i)
  95.     updateStage()
  96.   end repeat
  97.   go(label("ENCY") - 1)
  98.   hPrepMainInterface()
  99. end
  100.  
  101. on hTestforCDin
  102.   set vTest to mAnyOMNICDIsMounted(oVidCD)
  103.   if vTest = 1 then
  104.     return 1
  105.   else
  106.     if vTest = -1 then
  107.       alert("Sorry, this updated version of the Omnipedia will not run with the original Omnipedia CD. Please mount your revised copy of the Omnipedia or an Episode Guide CD before launching the program.")
  108.       stopThismovie()
  109.       quit()
  110.     else
  111.       if hFileIsHere(the pathName & "OMNIonCD.PRF") = 0 then
  112.         alert("Please mount one of your Omnipedia CD's before launching the program.")
  113.         stopThismovie()
  114.         quit()
  115.       end if
  116.     end if
  117.   end if
  118. end
  119.  
  120. on hInitConstants
  121.   if voidp(gComputerTypeK) then
  122.     if the machineType = 256 then
  123.       set gComputerTypeK to #WIN
  124.     else
  125.       set gComputerTypeK to #mac
  126.     end if
  127.   end if
  128.   if gComputerTypeK = #WIN then
  129.     set gDirectOrFolderK to "directory"
  130.   else
  131.     set gDirectOrFolderK to "folder"
  132.   end if
  133.   if gComputerTypeK = #WIN then
  134.     set gPDL to "\"
  135.   else
  136.     set gPDL to ":"
  137.   end if
  138.   set the exitLock to 1
  139.   hInitCurlyQ()
  140.   set gMemoryAlertFlag to 1
  141.   if gComputerTypeK = #WIN then
  142.     set gOurFontK to "TREKOMNI"
  143.   else
  144.     set gOurFontK to "TREKFAM"
  145.   end if
  146.   set gUpdateAttribFld to 510
  147.   if not (the name of cast gUpdateAttribFld starts "UPDATE") then
  148.     hputmsg("!!The UPDATE text field does not appear where it was expected. Updates may not work.")
  149.     beep(2)
  150.   end if
  151.   set gFirstYearK to 18
  152.   set gLastYearK to 24
  153.   set gEpisFTchunksizeK to 10
  154.   hSetStylingNeed(0)
  155.   hSetStylePermit(1)
  156.   set gModeNameLU to [#ENCY: "Encyclopedia", #FoundSet: "Search Results"]
  157.   hPrepBreakList()
  158.   hPrepHyperExceptions()
  159.   set the visible of sprite 22 to 1
  160. end
  161.  
  162. on hPrepMainInterface
  163.   hSetGlobalCounter(1)
  164.   hSetLocalCounter(1)
  165.   set the itemDelimiter to "@"
  166.   put "Preparing interface parameters..." into field "Status"
  167.   hAnnounce("EngSignalBeep")
  168.   hInitSpritesNbuttons()
  169.   set the mouseDownScript to "hMouseEventSupervisor"
  170.   set gSavedMouseUpScript to the mouseUpScript
  171.   startTimer()
  172.   put "Preparing media lists..." into field "Status"
  173.   hAnnounce("OneHiBeep")
  174.   mInitScrollStuff(oTextScroller)
  175.   hSetupThumbs()
  176.   hInitMinaWLists()
  177.   mCheckHeader(oINTERfaceFind)
  178.   if not objectp(oASRObj) then
  179.     hShowSpeechStatus(#null)
  180.   else
  181.     hShowSpeechStatus(#INACTIVE)
  182.   end if
  183.   hInitTracker()
  184.   cursor([gTrekCursor, gTrekCursor + 1])
  185.   if gNewSetIsHereF then
  186.     hAnnounce("To Found Entries Mode")
  187.   end if
  188.   set gModeState to EMPTY
  189.   hSetMode(#ENCY)
  190.   hLIneUp()
  191.   hMatchEntryToIndexLine(1)
  192.   put "Ready." into field "Status"
  193.   hAnnounce("Ready 1")
  194. end
  195.  
  196. on hShowTheUpdate pNum
  197.   hSwitchFTsearchscope(#ALL)
  198.   if pNum = 2 then
  199.     set lit to value(field gUpdateAttribFld)
  200.     if not objectp(lit) then
  201.       hearit(gNopeSND)
  202.       hReportStatus("This copy of the Omnipedia has not yet been updated.")
  203.       abort()
  204.     else
  205.       hReportStatus("Displaying newly updated entries.")
  206.     end if
  207.   else
  208.     if pNum = 3 then
  209.       set lit to value(field "video_entries")
  210.     end if
  211.   end if
  212.   mSetCustomList(oIndexScroller, lit, 1, pNum)
  213.   set kall to mGetThisEntryName(oIndexMediator, #FoundSet, 1, gGlobalStepCount)
  214.   hSetIndex(hFilterSearchChars(kall), kall)
  215.   hProcess(kall)
  216.   if pNum = 2 then
  217.     hReportStatus("These are the entries added during the most recent update.")
  218.   end if
  219. end
  220.  
  221. on hShowTheFoundHits pNum, pType
  222.   if pType = 1 then
  223.     mSetCustomList(oIndexScroller, gStashedHitsList, pNum, 1)
  224.   else
  225.     if pType = 0 then
  226.       mSetCustomList(oIndexScroller, gStashedSEEList, pNum, 0)
  227.     else
  228.     end if
  229.   end if
  230.   set kall to mSetOneFTfromLU(oSLlookup, pNum)
  231.   hSetIndex(hFilterSearchChars(kall), kall)
  232.   hProcess(kall)
  233. end
  234.  
  235. on hInitMainIndex
  236.   hSetAlphaState("A")
  237.   hSetGlobalCounter(1)
  238.   hSetLocalCounter(1)
  239.   hCreateIndexObjs()
  240.   hSwitchFTsearchscope(1)
  241. end
  242.  
  243. on stopThismovie
  244.   hClearExtListSaver()
  245.   hInitMinaWLists()
  246.   set the fileName of cast "BlankM.dir" to the pathName & "BL" & gPDL & "BlankM.dir"
  247.   if gComputerTypeK = #WIN then
  248.     hSetColorBack()
  249.   else
  250.     hCloseMacColor()
  251.   end if
  252.   closeXLib()
  253.   hputmsg("Stopping...")
  254. end
  255.  
  256. on hPollLinked
  257.   if glinktostagemsg <> EMPTY then
  258.     do(glinktostagemsg)
  259.     set glinktostagemsg to EMPTY
  260.   end if
  261. end
  262.  
  263. on hCycle
  264.   hDetectKeyRoll(the mouseWord, gdescfield)
  265.   hSetStylePermit(1)
  266.   if gStylingNeedF then
  267.     hStyleMe()
  268.   end if
  269.   cursor([gTrekCursor, gTrekCursor + 1])
  270.   go(the frame)
  271. end
  272.  
  273. on hCycleRes
  274.   hPollLinked()
  275.   hSetStylePermit(1)
  276.   if gStylingNeedF then
  277.     hStyleMe()
  278.   end if
  279.   hMemoryMonitor()
  280.   cursor([gTrekCursor, gTrekCursor + 1])
  281.   go(label("Resources"))
  282. end
  283.  
  284. on hMemoryMonitor
  285.   if the freeBytes < 500000 then
  286.     if gMemoryAlertFlag then
  287.       set gMemoryAlertFlag to 0
  288.       unLoadCast()
  289.     end if
  290.   end if
  291. end
  292.  
  293. on hMouseEventSupervisor
  294.   global gEditKeys
  295.   hSysAlert(#null)
  296.   hSetStylePermit(0)
  297.   set gTheMseLine to the mouseLine
  298.   set gTheMseWord to the mouseWord
  299.   if gEditKeys then
  300.     if gTheMseWord > 0 then
  301.       if not hCheckForEditMode(gTheMseWord) then
  302.         pass()
  303.       else
  304.         dontPassEvent()
  305.       end if
  306.     end if
  307.   else
  308.     pass()
  309.   end if
  310. end
  311.  
  312. on hResourceMouseEventSupervisor
  313.   hSysAlert(#null)
  314.   hSetStylePermit(0)
  315.   set gTheMseLine to the mouseLine
  316.   set gTheMseWord to the mouseWord
  317.   pass()
  318. end
  319.  
  320. on hKeyEventSupervisor
  321.   hSetStylePermit(0)
  322. end
  323.  
  324. on hInitSpritesNbuttons
  325.   set gdescfieldspr to 5
  326.   set gSearchPopOut to 7
  327.   set gNextBase to 9
  328.   set gFindBase to 10
  329.   set gModeBase to 11
  330.   set gUpdateBase to 39
  331.   set gHeaderHere to 12
  332.   set gModeHighltSprite to 13
  333.   set gPullDownSearch to 14
  334.   set gPullDownModes to 22
  335.   set gSearchButton to 16
  336.   set gEncSprite to 17
  337.   set gEntrySprite to 18
  338.   set gInputFieldSpr to 19
  339.   set gTopicBase to 20
  340.   set gHoldEncPixelSprite to 23
  341.   set gHoldEntPixelSprite to 21
  342.   set gFlashPixel to 24
  343.   set gSpeeButtSpr to 25
  344.   set gTxtScrSprsBeg to 31
  345.   set gAlphBase to 39
  346.   set gSysStatusWordSpr to 37
  347.   set gStretchSpr1 to 39
  348.   set gStretchSpr2 to 40
  349.   set gEpisBase to 39
  350.   set gHltPixel to 47
  351.   hInterFace()
  352.   hInitSysAlertWords()
  353.   hInitSpeeButts()
  354. end
  355.  
  356. on hSetWindowsColor
  357.   openXLib("color.dll")
  358.   set gColorXobj to Color(mnew)
  359.   set gPrevActiveColor to gColorXobj(mGetSysColor, 2)
  360.   set gPrevInactiveColor to gColorXobj(mGetSysColor, 3)
  361.   put gColorXobj(mSetSysColorRGB, 2, 0, 0, 0)
  362.   put gColorXobj(mSetSysColorRGB, 3, 0, 0, 0)
  363.   put gColorXobj(mdispose)
  364.   closeXLib("color.dll")
  365. end
  366.  
  367. on hSetColorBack
  368.   openXLib("color.dll")
  369.   set gColorXobj to Color(mnew)
  370.   put gColorXobj(mSetSysColor, 2, gPrevActiveColor)
  371.   put gColorXobj(mSetSysColor, 3, gPrevInactiveColor)
  372.   put gColorXobj(mdispose)
  373.   closeXLib("color.dll")
  374. end
  375.  
  376. on hSetMacColor
  377.   if gComputerTypeK = #mac then
  378.     if hFileIsHere(the pathName & "omnicolor.xcmd") and hFileIsHere(the pathName & "OmniWinRes") then
  379.       openXLib("OmniColor.xcmd")
  380.       openResFile("OmniWinRes")
  381.       set gMacColorIsHere to 1
  382.     end if
  383.   else
  384.     set gMacColorIsHere to 0
  385.   end if
  386. end
  387.  
  388. on hCloseMacColor
  389.   if gComputerTypeK = #mac then
  390.     if gMacColorIsHere then
  391.       closeXLib("OmniColor.xcmd")
  392.       closeResFile("OmniWinRes")
  393.     end if
  394.   end if
  395. end
  396.  
  397. on tong
  398.   global gStylingNeedF, gkeylist, gdescfield
  399.   set exceptList to the text of cast "Hyperlink Exceptions"
  400.   set exceptList to value(exceptList)
  401.   sort(exceptList)
  402.   repeat with i = 1 to 26
  403.     set attrib to "ATTRIB_" & numToChar(65 + i - 1) & "_ENCY"
  404.     set vCurrentList to the text of cast attrib
  405.     set vCurrentList to value(vCurrentList)
  406.     sort(vCurrentList)
  407.     repeat with j = 1 to count(vCurrentList)
  408.       put "ATTRIB: " & numToChar(65 + i - 1) & " ENTRY " & j
  409.       put getPropAt(vCurrentList, j) into field "searchtextcandidate"
  410.       set entryname to the text of field "searchtextcandidate"
  411.       hFindThisEntry()
  412.       hSetStylePermit(1)
  413.       if gStylingNeedF then
  414.         hStyleMe()
  415.       end if
  416.       set keylistCount to count(gkeylist)
  417.       repeat with k = 1 to keylistCount
  418.         set W1 to getPropAt(gkeylist, k)
  419.         set firstReturn to offset(RETURN, field gdescfield)
  420.         set numWordsInTitle to the number of words in char 1 to firstReturn of field gdescfield
  421.         if (W1 > 1) and (W1 <= the number of words in field gdescfield) and (W1 > numWordsInTitle) then
  422.           set wordinfo to getAt(gkeylist, k)
  423.           set numwords to getAt(wordinfo, 1)
  424.           set wordstyle to getAt(wordinfo, 2)
  425.           set word1start to word 1 to W1 + numwords - 1 of field gdescfield
  426.           if (wordstyle = #b) or (wordstyle = #bi) then
  427.             set trunk to hcleanup(word W1 to W1 + numwords - 1 of field gdescfield)
  428.             set found to findPos(exceptList, trunk)
  429.             if found then
  430.               set trunk to getAt(exceptList, found)
  431.             else
  432.               if trunk = "DeSoto" then
  433.                 set trunk to "DeSoto, Captain Robert"
  434.               end if
  435.             end if
  436.             set trunk to curly(trunk)
  437.             set firstChar to char 1 of trunk
  438.             set firstAscii to charToNum(firstChar)
  439.             if ((firstAscii >= 65) and (firstAscii <= 90)) or ((firstAscii >= 97) and (firstAscii <= 122)) then
  440.               set destAttrib to "ATTRIB_" & firstChar & "_ENCY"
  441.               set vDestList to the text of cast destAttrib
  442.               set vDestList to value(vDestList)
  443.               sort(vDestList)
  444.               if findPos(vDestList, trunk) or findPos(vDestList, trunk & " ") then
  445.                 put trunk & " is found"
  446.               else
  447.                 set newtrunk to hTryHarder(trunk)
  448.                 set firstChar to char 1 of newtrunk
  449.                 set firstAscii to charToNum(firstChar)
  450.                 if ((firstAscii >= 65) and (firstAscii <= 90)) or ((firstAscii >= 97) and (firstAscii <= 122)) then
  451.                   set destAttrib to "ATTRIB_" & firstChar & "_ENCY"
  452.                   set vDestList to the text of cast destAttrib
  453.                   set vDestList to value(vDestList)
  454.                   sort(vDestList)
  455.                   if findPos(vDestList, newtrunk) or findPos(vDestList, newtrunk & " ") then
  456.                     put trunk & " => " & newtrunk & " is found"
  457.                   else
  458.                     set newtrunk to hTryCap(trunk)
  459.                     set firstChar to char 1 of newtrunk
  460.                     set firstAscii to charToNum(firstChar)
  461.                     if ((firstAscii >= 65) and (firstAscii <= 90)) or ((firstAscii >= 97) and (firstAscii <= 122)) then
  462.                       set destAttrib to "ATTRIB_" & firstChar & "_ENCY"
  463.                       set vDestList to the text of cast destAttrib
  464.                       set vDestList to value(vDestList)
  465.                       sort(vDestList)
  466.                       if findPos(vDestList, newtrunk) or findPos(vDestList, newtrunk & " ") then
  467.                         put trunk & " => " & newtrunk & " is found"
  468.                       else
  469.                         set newtrunk to hIsADoctor(trunk)
  470.                         set firstChar to char 1 of newtrunk
  471.                         set firstAscii to charToNum(firstChar)
  472.                         if ((firstAscii >= 65) and (firstAscii <= 90)) or ((firstAscii >= 97) and (firstAscii <= 122)) then
  473.                           set destAttrib to "ATTRIB_" & firstChar & "_ENCY"
  474.                           set vDestList to the text of cast destAttrib
  475.                           set vDestList to value(vDestList)
  476.                           sort(vDestList)
  477.                           if findPos(vDestList, newtrunk) or findPos(vDestList, newtrunk & " ") then
  478.                             put trunk & " => " & newtrunk & " is found"
  479.                           else
  480.                             set newtrunk to hLastNameFirst(trunk)
  481.                             set firstChar to char 1 of newtrunk
  482.                             set firstAscii to charToNum(firstChar)
  483.                             if ((firstAscii >= 65) and (firstAscii <= 90)) or ((firstAscii >= 97) and (firstAscii <= 122)) then
  484.                               set destAttrib to "ATTRIB_" & firstChar & "_ENCY"
  485.                               set vDestList to the text of cast destAttrib
  486.                               set vDestList to value(vDestList)
  487.                               sort(vDestList)
  488.                               if findPos(vDestList, newtrunk) or findPos(vDestList, newtrunk & " ") then
  489.                                 put trunk & " => " & newtrunk & " is found"
  490.                               else
  491.                                 set newtrunk to williamRiker(trunk)
  492.                                 set firstChar to char 1 of newtrunk
  493.                                 set firstAscii to charToNum(firstChar)
  494.                                 if ((firstAscii >= 65) and (firstAscii <= 90)) or ((firstAscii >= 97) and (firstAscii <= 122)) then
  495.                                   set destAttrib to "ATTRIB_" & firstChar & "_ENCY"
  496.                                   set vDestList to the text of cast destAttrib
  497.                                   set vDestList to value(vDestList)
  498.                                   sort(vDestList)
  499.                                   if findPos(vDestList, newtrunk) or findPos(vDestList, newtrunk & " ") then
  500.                                     put trunk & " => " & newtrunk & " is found"
  501.                                   else
  502.                                     put trunk & " is not found anywhere"
  503.                                     repeat with L = 1 to numwords
  504.                                       removeLink(W1 + L - 1)
  505.                                       hReviseEntry()
  506.                                     end repeat
  507.                                   end if
  508.                                 else
  509.                                   put trunk & " not found"
  510.                                   repeat with L = 1 to numwords
  511.                                     removeLink(W1 + L - 1)
  512.                                     hReviseEntry()
  513.                                   end repeat
  514.                                 end if
  515.                               end if
  516.                             else
  517.                               put trunk & " not found"
  518.                               repeat with L = 1 to numwords
  519.                                 removeLink(W1 + L - 1)
  520.                                 hReviseEntry()
  521.                               end repeat
  522.                             end if
  523.                           end if
  524.                         else
  525.                           put trunk & " not found"
  526.                           repeat with L = 1 to numwords
  527.                             removeLink(W1 + L - 1)
  528.                             hReviseEntry()
  529.                           end repeat
  530.                         end if
  531.                       end if
  532.                     else
  533.                       put trunk & " not found"
  534.                       repeat with L = 1 to numwords
  535.                         removeLink(W1 + L - 1)
  536.                         hReviseEntry()
  537.                       end repeat
  538.                     end if
  539.                   end if
  540.                 else
  541.                   put trunk & " not found"
  542.                   repeat with L = 1 to numwords
  543.                     removeLink(W1 + L - 1)
  544.                     hReviseEntry()
  545.                   end repeat
  546.                 end if
  547.               end if
  548.               next repeat
  549.             end if
  550.             put trunk & "not found"
  551.             repeat with L = 1 to numwords
  552.               removeLink(W1 + L - 1)
  553.               hReviseEntry()
  554.             end repeat
  555.           end if
  556.         end if
  557.       end repeat
  558.     end repeat
  559.   end repeat
  560. end
  561.  
  562. on williamRiker pEntry
  563.   if (pEntry = "Riker, William") or (pEntry = "William Riker") or (pEntry = "Riker, William T") then
  564.     return "Riker, William T."
  565.   else
  566.     return pEntry
  567.   end if
  568. end
  569.  
  570. on removeLink aWordNum
  571.   heditwordstyle(aWordNum, #b)
  572.   put "...hCheckForEditMode CMD at word" && aWordNum
  573. end
  574.  
  575. on curly pEntry
  576.   set curlyOffset to offset(numToChar(213), pEntry)
  577.   set numOfChars to the number of chars in pEntry
  578.   if curlyOffset > 0 then
  579.     return char 1 to curlyOffset - 1 of pEntry & "'" & char curlyOffset + 1 to numOfChars of pEntry
  580.   else
  581.     return pEntry
  582.   end if
  583. end
  584.